Satan was invented when the 6th century BCE Monotheists gained ascendancy.
Before then, by far the largest number of people accepted the existence of several gods. The monotheists are responsible for the Hebrew Bible that we read today, and they freely acknowledge that the people worshipped several Gods, including theirs (Baal, Asherah, etc.)
When the monotheists came to power, they ran into the problem of the existence of "badness". Previously, the people had any number of gods who could be blamed, so now they had to invent a scenario that put YHWH at arm's length from "badness". Check the www for the word: Theodicy
Gradually, this "son of God", Satan, became personified in writings such as 1 Enoch and Jubilees.
I take issue with any idea that Satan was in the Garden of Eden story. That idea was invented in the 2nd century CE, after the writing of the Scriptures.
When the Septuagint was written in the 3rd and 2nd centuries BCE, they imported the Greek word Diabolos (meaning: Devil).
Satan was never known in the Scriptures as "Lucifer". That word means the planet Venus, the Bright Morning Star (the name given to Jesus in the Book of Revelation).
Doug